package com.spzx.product.api.domain;

import com.baomidou.mybatisplus.annotation.TableField;
import com.baomidou.mybatisplus.annotation.TableName;
import com.spzx.common.core.web.domain.BaseEntity;

import java.io.Serial;
import java.util.List;

import io.swagger.v3.oas.annotations.media.Schema;
import lombok.*;
import lombok.experimental.SuperBuilder;

/**
 * <p>
 * 商品
 * </p>
 *
 * @author Haoran Sun
 * @since 2024-07-15
 */
@EqualsAndHashCode(callSuper = true)
@Data
@TableName("product")
@Schema(description = "商品")
@AllArgsConstructor
@NoArgsConstructor
@SuperBuilder
public class Product extends BaseEntity {

    @Serial
    private static final long serialVersionUID = 1L;

    @Schema(description = "商品名称")
    @TableField("name")
    private String name;

    @Schema(description = "品牌ID")
    @TableField("brand_id")
    private Long brandId;

    @Schema(description = "一级分类id")
    @TableField("category1_id")
    private Long category1Id;

    @Schema(description = "二级分类id")
    @TableField("category2_id")
    private Long category2Id;

    @Schema(description = "三级分类id")
    @TableField("category3_id")
    private Long category3Id;

    @Schema(description = "计量单位")
    @TableField("unit_name")
    private String unitName;

    @Schema(description = "轮播图")
    @TableField("slider_urls")
    private String sliderUrls;

    @Schema(description = "商品规格json")
    @TableField("spec_value")
    private String specValue;

    @Schema(description = "线上状态：0-初始值，1-上架，-1-自主下架")
    @TableField("status")
    private Byte status;

    @Schema(description = "审核状态：0-初始值，1-通过，-1-未通过")
    @TableField("audit_status")
    private Byte auditStatus;

    @Schema(description = "审核信息")
    @TableField("audit_message")
    private String auditMessage;

    /**
     * 品牌名称
     */
    @Schema(description = "品牌")
    @TableField(exist = false)
    private String brandName;
    /**
     * 一级分类名称
     */
    @Schema(description = "一级分类")
    @TableField(exist = false)
    private String category1Name;
    /**
     * 二级分类名称
     */
    @Schema(description = "二级分类")
    @TableField(exist = false)
    private String category2Name;
    /**
     * 三级分类名称
     */
    @Schema(description = "三级分类")
    @TableField(exist = false)
    private String category3Name;

    @Schema(description = "商品sku列表")
    @TableField(exist = false)
    private List<ProductSku> productSkuList;

    @Schema(description = "详情图片列表")
    @TableField(exist = false)
    private List<String> detailImagesUrlList;

}
